Skip to content

accounts_password_all_shadowed_sha512: Fix test file and add yescrypt support for RHEL 10+ - #14967

Open
ggbecker wants to merge 2 commits into
ComplianceAsCode:masterfrom
ggbecker:worktree-fix-sha512-test
Open

accounts_password_all_shadowed_sha512: Fix test file and add yescrypt support for RHEL 10+#14967
ggbecker wants to merge 2 commits into
ComplianceAsCode:masterfrom
ggbecker:worktree-fix-sha512-test

Conversation

@ggbecker

@ggbecker ggbecker commented Aug 6, 2026

Copy link
Copy Markdown
Member

Description:

Fixes two issues with the accounts_password_all_shadowed_sha512 rule:

  1. Fixed malformed shadow entry in test file (missing last-changed date field)
  2. Added yescrypt password hash support for RHEL 10+, Oracle Linux 10+, and Fedora

Rationale:

Test file fix:
The sha512_password.pass.sh test had an invalid shadow entry with an empty field, causing test failures.

Yescrypt support:
RHEL 10 uses yescrypt as the default password hashing algorithm instead of SHA-512. Both are FIPS 140-3 approved, but without this change, RHEL 10 systems would fail STIG checks despite using stronger security. The implementation uses family-based conditionals to automatically support future RHEL/OL versions.

Technical note: The OVAL Unix schema doesn't include yescrypt in the encrypt_method enumeration, so the implementation uses password pattern matching instead.

Review Hints:

Test on RHEL 10:

./build_product rhel10 --rule-id accounts_password_all_shadowed_sha512
cd tests
./automatus.py rule --libvirt qemu:///system <vm-name> \
    --datastream ../build/ssg-rhel10-ds.xml \
    accounts_password_all_shadowed_sha512

…ged field

The sha512_password.pass.sh test had a malformed shadow entry on line 10
(locked6). The entry had an empty last-changed field (::) which created
an invalid shadow file format.

The shadow file format requires 9 colon-separated fields:
username:password:lastchanged:min:max:warn:inactive:expire:reserved

Fixed by adding the last-changed date (18793) to match the other test
entries, ensuring the shadow entry is properly formatted.

This resolves the productization test failure for
accounts_password_all_shadowed_sha512/sha512_password.pass
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Used by openshift-ci bot. label Aug 6, 2026
@openshift-ci

openshift-ci Bot commented Aug 6, 2026

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@ggbecker ggbecker added this to the 0.1.82 milestone Aug 6, 2026
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

This datastream diff is auto generated by the check Compare DS/Generate Diff

Click here to see the full diff
New content has different text for rule 'xccdf_org.ssgproject.content_rule_accounts_password_all_shadowed_sha512'.
--- xccdf_org.ssgproject.content_rule_accounts_password_all_shadowed_sha512
+++ xccdf_org.ssgproject.content_rule_accounts_password_all_shadowed_sha512
@@ -14,8 +14,10 @@
 $6$kcOnRq/5$NUEYPuyL.wghQwWssXRcLRFiiru7f5JPV6GaJhNC2aK5F3PZpE/BCCtwrxRc/AInKMNX3CdMw11m9STiql12f/
 Password hashes ! or * indicate inactive accounts not
 available for logon and are not evaluated.
-If any interactive user password hash does not begin with $6,
-this is a finding.
+
+
+If any interactive user password hash does not begin with $6
+(SHA-512) or $y$ (yescrypt), this is a finding.
 
 [reference]:
 IA-5(1)(c)

OCIL for rule 'xccdf_org.ssgproject.content_rule_accounts_password_all_shadowed_sha512' differs.
--- ocil:ssg-accounts_password_all_shadowed_sha512_ocil:questionnaire:1
+++ ocil:ssg-accounts_password_all_shadowed_sha512_ocil:questionnaire:1
@@ -7,5 +7,10 @@
 
 Password hashes ! or * indicate inactive accounts not
 available for logon and are not evaluated.
-      Is it the case that any interactive user password hash does not begin with "$6"?
+
+
+
+On Fedora and later versions, yescrypt ($y$) is also acceptable
+as it provides stronger password hashing than SHA-512.
+      Is it the case that any interactive user password hash does not begin with "$6" or "$y$"?
       

…all_shadowed_sha512

RHEL 10 (and Oracle Linux 10, Fedora) use yescrypt as the default password
hashing algorithm, which is FIPS 140-3 approved and provides stronger security
than SHA-512. This change updates the rule to accept both SHA-512 and yescrypt
for RHEL 10+ systems while maintaining SHA-512-only enforcement for RHEL 8/9.

Changes:
- Updated OVAL check to accept yescrypt ($y$) hashes for RHEL 10+
- Updated OVAL to exclude locked yescrypt passwords (similar to locked SHA-512)
- Updated rule description, OCIL clause, and OCIL to mention yescrypt support
- Added platform-specific test scenario: yescrypt_password.pass.sh (RHEL 10+)
- Used pattern matching for yescrypt instead of encrypt_method (not in OVAL schema)
- Used family-based conditionals: product == "fedora" or (('rhel' in product or
  'ol' in families) and product not in ['ol7', 'ol8', 'ol9', 'rhel8', 'rhel9'])
- This automatically includes future versions (RHEL 11+, OL 11+) without hardcoding

Rationale:
The SRG requirement (SRG-OS-000073, SRG-OS-000120) mandates "FIPS 140-3 approved
cryptographic hashing algorithms" but does not require SHA-512 specifically.
Yescrypt is FIPS 140-3 approved and is the RHEL 10 default, so the rule should
accept it to avoid forcing users to downgrade security.

Testing:
- All Automatus tests pass on RHEL 10
- SHA-512 passwords: PASS
- Yescrypt passwords: PASS
- MD5 passwords: FAIL (as expected)
- Locked SHA-512/yescrypt: Correctly excluded

Related: productization test failure for sha512_password.pass.sh
@ggbecker
ggbecker force-pushed the worktree-fix-sha512-test branch from 9cbb310 to ffde553 Compare August 10, 2026 11:47
@ggbecker

Copy link
Copy Markdown
Member Author

test results:

10.2	pass	/per-rule/oscap/from-env	accounts_password_all_shadowed_sha512/md5_password.fail		
10.2	pass	/per-rule/oscap/from-env	accounts_password_all_shadowed_sha512/sha256_password.fail		
10.2	pass	/per-rule/oscap/from-env	accounts_password_all_shadowed_sha512/sha512_password.pass		waived pass
10.2	pass	/per-rule/oscap/from-env	accounts_password_all_shadowed_sha512/yescrypt_password.pass		
10.2	pass	/per-rule/oscap/from-env

@ggbecker
ggbecker marked this pull request as ready for review August 10, 2026 12:03
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Used by openshift-ci bot. label Aug 10, 2026
@ggbecker

Copy link
Copy Markdown
Member Author

Here the only question that remains is that the rule alludes to sha512 and introducing a new yescript algorithm might open the interpretation of the rule. But I didn't want to create yet another rule since both parameters should be safe. The question will probably be to influence the policy makers to accept this new parameter too.

@Mab879 Mab879 self-assigned this Aug 10, 2026

@Mab879 Mab879 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per DISA yescrypt is not FIPS 140-3 approved (the underlying hashing is, yescrypt itself is not) , all passwords must be SHA 512. So we will need figure some else out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

accounts_password_all_shadowed_sha512/sha512_password.pass fails in daily productization

2 participants